home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compendium Deluxe 2
/
LSD and 17bit Compendium Deluxe - Volume II.iso
/
a
/
prog
/
asmsrc
/
thesource-7.lha
/
Source
/
Articles
/
Stereoscopic
/
SegaGlasses.lha
/
SegaGlasses
/
circuit.lcd
< prev
next >
Wrap
Text File
|
1992-09-15
|
13KB
|
302 lines
SEGA GLASSES INTERFACE FOR THE RS232 PORT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comments/enquiries/money(8-)) to:
Glen Harris
2harrig@wench.ece.jcu.edu.au
James Cook University of North Queensland
First off, here's the circuits: Warning! This is drawn using ASCII
graphics characters. It may not
print out correctly on some printers.
RTS/DTR control version
~~~~~~~~~~~~~~~~~~~~~~~
+VE
³
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄoÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄ¿ ³
³ ³ ÚÄÄÄÄÄÄÄÄ¿ ³ ³ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ ³ ÚÄ´1 8ÃÄoÄ%%%%Ä¿ ³ ÚÄÄÄÅÄÄ¿ ÚÄÄÅÄÄÄÄÄoÄÄoÄÄÄ¿ ³
³ ³ ³ ³ ³ R1 ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³
³ ÀÄÅÄ´2 7ÃÄÄÄÄÄÄÄÄo ³ ³ ÚÄÁÄÄÁÄÄÁÄÄÁÄÄÁÄÄÁÄÄÁÄ¿ ³ ³
³ ³ ³ IC1 ³ R2 ³ ³ ³ ³14 13 12 11 10 9 8 ³ ³ ³
³ ÚÄÅÄ´3 6ÃÄoÄ%%%%ÄÙ ³ ³ ³ IC2 ³ ³ ³
³ ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄo ³ ³ 1 2 3 4 5 6 7 ³ ³ ³ TO STEREO
ÀÄÅÄÅÄ´4 5ÃÄÄÄÄ¿ ³ ³ ÀÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÙ ³ ³ CONNECTOR
³ ³ ÀÄÄÄÄÄÄÄÄÙ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ =========
³ ³ C1 === === C2 ÀÄÄÄoÄÄÅÄÄÅÄÄÅÄÄÅÄÄÙ ³ ³ ÀÄÄÄÄ COMMON
³ ³ ³ ³ ³ ³ ³ ÀÄÄÅÄÄÄÄÄÅÄÄÄÅÄÄÄÄÄÄ TIP
³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄoÄÄÄÄÄo ³ ³ ÀÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÅÄÄÄÄÄÄ MIDDLE
³ ³ ÀÄÄÄÄÄÄÄÄÄÄÅÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄoÄÄÄÙ
³ GND ³ ³ ³ ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ DTR RTS GND
TO RS232 CONNECTOR
RTS only version
~~~~~~~~~~~~~~~~
+VE
³
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄoÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄoÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄ¿ ³ ³
³ ³ ÚÄÄÄÄÄÄÄÄ¿ ³ ³ ³ ÚÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ¿
³ ³ ÚÄ´1 8ÃÄoÄ%%%%Ä¿ ³ ÚÄÄÄÅÄÄ¿ ÚÄÄÅÄÄÄÄÄÅÄÄÄÄÄÄÄÄ¿ ³
³ ³ ³ ³ ³ R1 ³ ³ ÚÄÅÄÄÄÅÄÄÅÄÄÅÄÄÅÄÄ¿ ³ ÚÄÄÄ¿ ³ ³
³ ÀÄÅÄ´2 7ÃÄÄÄÄÄÄÄÄo ³ ³ ³ ÚÄÁÄÄÁÄÄÁÄÄÁÄÄÁÄÄÁÄÄÁÄ¿ ³ ³ ³
³ ³ ³ IC1 ³ R2 ³ ³ ³ ³ ³14 13 12 11 10 9 8 ³ ³ ³ ³
³ ÚÄÅÄ´3 6ÃÄoÄ%%%%ÄÙ ³ ³ ³ ³ IC2 ³ ³ ³ ³
³ ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄo ³ ³ ³ 1 2 3 4 5 6 7 ³ ³ ³ ³
ÀÄÅÄÅÄ´4 5ÃÄÄÄÄ¿ ³ ³ ³ ÀÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÄÂÄÙ ³ ³ ³
³ ³ ÀÄÄÄÄÄÄÄÄÙ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³
³ ³ C1 === === C2³ ÀÄÄÄoÄÄÅÄÄÅÄÄÅÄÄÅÄÄÙ ³ ³ ³ ÀÄÄCOM
³ ³ ³ ³ ÀÄÄÄÄÄÅÄÄo ³ ÀÄÄÅÄÄÄÄÄÅÄÄÄÅÄÅÄÄÄÄTIP
³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄoÄÄÄÄÄo ³ ÀÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÅÄÅÄÄÄÄMID
³ ³ ÀÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄoÄÄÄÅÄÙ
³ GND ³ oÄÄÄÄÄÅÄÄÄÙ
³ ³ ³ ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ RTS GND
TO RS232 CONNECTOR
Components needed
~~~~~~~~~~~~~~~~~
R1 1K ohm resistor
R2 180K ohm resistor (I used a 200K trimpot)
C1 0.1uF capacitor
C2 0.01uF capacitor
IC1 555 timer
IC2 4030 quad 2-input XOR
³ ³
³ ³
ÄÄÄoÄÄÄ ÄÄÄÄoÄÄÄÄÄ THESE WIRES ARE JOINED TOGETHER
³
³
³ ³
ÄÄÄÅÄÄÄÄ ³
³ ÄÄÄÄÄÅÄÄÄÄÄ THESE WIRES ARE _NOT_ JOINED
ÄÄÄÅÄÄÄ ³
³ ³
How it works
~~~~~~~~~~~~
The circuit consists of a 555 timer in it's astable configuration,
oscillating at 400Hz. The output of the timer is XORed with the
DTR and RTS lines of the RS232 port, to control each lens separately.
The RTS only verion takes the RTS input and inverts it through the
spare XOR gate, which feeds it to the former DTR input. The changes
to the "How LCD's work" section should be fairly obvious.
How LCD's work
~~~~~~~~~~~~~~
The LCD panel is two sheets of polarised plastic/glass, with their
axes of polarizarion parallel to each other. This means that the
light entering one piece is polarised, and then exits through the
other piece, as it has the same polarization.
When an alternating electric field is passed through the liquid
crystal between the sheets, the polarization of the light is changed
by an amount inherent in the design of the LCD, usually 90 or 270
degrees, for minimum passage of light.
When this light reaches the second polarized panel, the planes of
polarization are at 90 degrees to each other - and so no, or very
little light is transmitted.
Electrical Connections
~~~~~~~~~~~~~~~~~~~~~~
The LCD panel is designed to turn opaque when a potential oscillating
between +10V and -10V is placed across it's connectors. This would mean
grounding one connector and placing an oscillating +/-10V potential on
the other. Since getting -/+10V would unnecesarily complicate the
circuit, this effect is achieved by placing +10V across the connectors
and then, effectively, _REVERSING_ the connectors, letting current flow
the other way. As far as the LCD is concerned, it's getting +/-10V.
Practically, this is done by feeding the 555's output to each of the
connectors on the panels, namely, the backplane and the left and right
connectors.
The square wave goes through 3 of the XORs, with the input to the one
connected to the backplane tied to ground so it acts as a simple buffer.
The DTR and RTS lines are connected to the inputs of the other two XORs.
When the RTS and DTR lines are low, the outputs are in phase, and so
there is a potential difference of zero volts on each LCD, having no
effect on the crystals.
When the DTR or RTS goes high, the output of the XOR is inverted with
respect to the input, giving a phase change of 180 degrees. This gives
a potential difference of 10V which oscillates at the frequency of the
555 timer.
RTS HIGH RTS LOW DTR HIGH DTR LOW
³ ³ ³ ³
ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿
BP Ù ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ À
ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄÄÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿
L Ù ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÄÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ À
ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄÄÄ¿ ÚÄ¿ ÚÄ¿ ÚÄ¿ ÚÄÄÄ¿ ÚÄ¿
R Ù ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ ÀÄÙ À
In the RTS/DTR version, one of the XOR gates is not used, so it's
inputs are tied low to prevent free oscillation, and the danger of
thermal damage.
The circuit looks a bit complex, but pins 2 and 6 on the 555 can be
connected under the chip, and the same with 4 and 8, which makes
things a lot simpler. Not much can be done for the 4030.
The 180K resistor should give 398.89Hz if all the components are
exactly what they are marked, but since they rarely are, I used a
200K (or 500K, see below) variable resistor and a frequency counter
to get 400Hz.
Some people might like to try a faster oscillator, as some video
cards and monitors can switch images at 70Hz and above. As the
frame rate increases, it will start to interfere with the blanking
effect of the LCD. It is possible to increase the oscillation to
above 400Hz, HOWEVER this _must_ be done with caution, as I do not
know what will happen to the crystals if they are pushed too far.
I have heard of people using 512Hz (crystal driven) with no ill
effects, but this is entirely at your own risk, and I cannot be held
responsible for any resulting damage.
The circuit can be fitted on a 5cm by 2cm piece of veroboard,
including the stereo socket. This fits quite nicely in a project box
meant for an IR remote control, with the removeable front panel cut
to take a DB25 connector.
Here's the pinouts for the RS232 connector (DB9 and DB25 versions):
RS232 9 pin 25 pin
========================
RTS 4 20
DTR 7 4
GND 5 7
The whole thing is powered by a 9V battery from the battery holder in
rear of the box and has an on/off switch on the side. There is also a
power-on LED on the top and a LED on the DTR/RTS inputs to show me at a
glance if there is a signal _getting_ to the box before I start ripping
apart my code to find the bug.
Trouble Shooting
================
> Check the wiring.
> Check that power is getting to all the chips.
> Check the 555 is oscillating at ~400Hz on pin 3 and also on pins 1,
6 and 13 of the 4030.
> Check the 3 ouputs to the stereo socket with an oscilloscope.
> Tie the RTS and DTR pins high physically and confirm the waveform
is the same as the one drawn above.
> Check that the RTS and DTR signals actually reach the 4030 with a
logic probe/CRO _ON THE PINS_, not just the DB25/DB9.
Here's a sample program to test the glasses. The word at the bottom of
the screen should be the lens you can see out of. If the lenses are back
to front, simply switch the RTS and DTR wires. DO NOT edit the program
to change the #defines of LEFT and RIGHT. My programs will have an
option to reverse the lenses, and I hope most other programmers will do
so as well, but we _would_ like to set a standard, wouldn't we?
-------BEGIN-----cut here------
/*******************************************************************************
* *
* This program is a simple demo to test that the glasses are working *
* and that the lenses are the right way around. *
* *
* Glen Harris *
* 2harrig@wench.ece.jcu.edu.au *
* *
*******************************************************************************/
#include <stdio.h>
#include <dos.h>
unsigned int com_base[] = { 0x3f8, /* COM1 */
0x2f8, /* COM2 */
0x3e8, /* COM3 */
0x2e8 /* COM4 */
};
#define BOTH 0 /* Both lenses clear */
#define LEFT 1 /* Left lens clear */
#define RIGHT 2 /* Right lens clear */
#define NONE 3 /* Neither lens clear */
#define Glasses(x) outportb(base+4,(x)) /* Byte containing RTS and DTR bits */
void main(int argc)
{
unsigned int base; /* Comm port base from which to work */
unsigned char left, right;
base = com_base[1]; /* COM2 */
if (argc == 1) /* No options, */
{
left = LEFT; /* so lenses are the */
right = RIGHT; /* correct way around */
}
else /* If there is an option (any option), */
{
left = RIGHT; /* switch the lenses to */
right = LEFT; /* the other way around */
printf("Swapping lenses.\n");
}
while(!kbhit())
{
printf("%s\n", "Left");
Glasses(left); /* Clear left lens */
delay(500); /* Wait half a second */
printf("%s\n", "Right");
Glasses(right); /* Clear right lens */
delay(500); /* Wait half a second */
}
Glasses(BOTH); /* Clear both lenses */
getch();
}
------END--------cut here----